#pragma once
#include "d3dutil.h"
#include "LevelElement.h"
#include "Vertex.h"
#include <vector>
using namespace std;
//-----------------------------------------------------
// QuadPosColor Class									
//-----------------------------------------------------
class QuadPosColor : public LevelElement
{
public:
	QuadPosColor();				// Constructor
	virtual ~QuadPosColor();		// Destructor

	virtual void Initialize(ContentManager *pContentManager);
	virtual void Tick(const InputState & refInputState){}
	virtual void Draw(const RenderContext* pRenderContext);


private: 
	//-------------------------------------------------
	// Datamembers								
	//-------------------------------------------------
	ID3D10InputLayout*			m_pVertexLayout;
	ID3D10Buffer*				m_pVertexBuffer;
	ID3D10Buffer*				m_pIndexBuffer;

	ID3D10Effect*				m_pDefaultEffect;
	ID3D10EffectTechnique*		m_pDefaultTechnique;

	ID3D10EffectMatrixVariable* m_pWorldViewProjectionVariable;

	UINT m_VertexBufferStride;
	vector<VertexPosCol> m_VecVertices;
	vector<DWORD> m_VecIndices;

	void CreateEffect(ContentManager *pContentManager);
	void GetEffectVariables(ID3D10Effect* pEffect);
	void DefineInputlayout();
	void BuildShape();
	void AddTriangle (unsigned int a, unsigned int b, unsigned c);
	void BuildVertexBuffer();
	void BuildIndexBuffer();
	// -------------------------
	// Disabling default copy constructor and default 
	// assignment operator.
	// -------------------------
	QuadPosColor(const QuadPosColor& yRef);									
	QuadPosColor& operator=(const QuadPosColor& yRef);	
};

 
